﻿#region Imports
using System.ComponentModel;
using System.Windows;
using System.Windows.Input;
using PlayRandom.ViewModels;
#endregion Imports

namespace PlayRandom.Views
{
    /// <summary>
    /// Interaction logic for Settings.xaml
    /// </summary>
    public partial class SettingsView : Window
    {
        #region Constructors
        private SettingsView()
        {
            InitializeComponent();
        }

        public SettingsView(MainViewModel dataContext, SizeToContent sizeToContent)
            : this()
        {
            this.SizeToContent = sizeToContent = SizeToContent.WidthAndHeight;
            this.DataContext = dataContext;
        }
        #endregion Constructors

        #region Events
        private void Window_Closing(object sender, CancelEventArgs e)
        {
            this.Hide();
            e.Cancel = true;
        }

        private void sett_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
                case Key.Escape: this.Close(); break;
                default: break;
            }
        }
        #endregion Events
    }
}
